<template>
  <div class="container">
    <header>
      <a href="javascript:;" class="list-icon1" @click="jump">
        <i class="iconfont icon-up21"></i>
      </a>
      <a href="javascript:;" class="list-icon2">
        <i class="iconfont icon-kefu1"></i>
      </a>
      <h1>商品类目</h1>
    </header>
    <section>
      <div class="order-nav">
        <ul class="order-nav-ul">
          <li class="order-nav-li act">待付款</li>
          <li>待收货</li>
          <li>已完成</li>
          <li>全部订单</li>
        </ul>
      </div>
      <!-- 待付款订单 -->
      <!-- <div class="all-order" v-if="cartList.length">
        <ul class="all-order-ul" v-for="(item,index) in cartList" :key="index">
          <li class="all-order-li">
            <div class="order-wait">
              <span>等待付款</span>
            </div>
            <div class="order-info">
              <div class="order-info-img">
                <img :src="item.cover" alt="" />
              </div>
              <div class="order-info-msg">
                <p class="order-msg">{{item.goods_name}}</p>
              </div>
              <div class="order-info-count">
                <div class="order-oddprice">￥ {{item.sell_price}}</div>
                <span class="order-count">x{{item.num}}</span>
              </div>
            </div>
            <div class="order-price">
              <div class="order-price-must">
                需付款: <p>￥ {{item.sell_price}}</p>
              </div>
              <div class="pay">
              <p>去支付</p>
            </div>
            </div>
          </li>
        </ul>
      </div> -->
      <div class="all-order" v-if="cartList.length">
        <ul class="all-order-ul" v-for="(item, index) in cartList" :key="index">
          <li class="all-order-li">
            <div class="order-wait">
              <span>等待付款</span>
            </div>
            <div class="order-info">
              <img :src="item.cover" alt="" />
              <p class="order-msg">{{ item.goods_name }}</p>
              <span>x{{ item.num }}</span>
            </div>
            <div class="order-price">
              实付:
              <p>￥ {{ item.sell_price }}</p>
            </div>
          </li>
        </ul>
        <div class="order-price">
          <div class="order-price-must">
            需付款:
            <p>￥ {{ allInfo.allPrice }}</p>
          </div>
          <div class="pay">
            <p>去支付</p>
          </div>
        </div>
      </div>
      <!-- 没有订单 -->
      <div class="order-none" v-if="!cartList.length">
        <div class="order-none-img">
          <img src="../assets/image/10.png" alt="" />
        </div>
        <h2 class="order-none-msg">未发现有您的订单!</h2>

        <div class="order-none-btn">
          <router-link to="/" class="btn-msg"> 去首页逛逛 </router-link>
        </div>
      </div>
    </section>
    <Footer />
  </div>
</template>

<script>
import Footer from "../components/Footer.vue";
export default {
  data() {
    return {
      isShow: false,
    };
  },
  components: {
    Footer,
  },
  computed: {
    cartList() {
      return this.$store.state.detail.cartList;
    },
    allInfo() {
      return this.$store.getters["detail/allInfo"];
    },
  },
  methods: {
    jump() {
      this.$router.push("/myspec");
    },
  },
};
</script>

<style lang="less" scoped>
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: 50px;
  background: #00bf9d;
  /* display: flex; */
}

header h1 {
  line-height: 50px;
  font-weight: normal;
  color: #fff;
  text-align: center;
  font-size: 22px;
}

header a .icon-kefu1 {
  font-size: 35px;
  color: #fff;
  position: absolute;
  /* float: right; */
  right: 0;
  margin: 10px 10px auto auto;
}

header a .icon-up21 {
  font-size: 20px;
  color: #fff;
  /* float: left; */
  position: absolute;
  left: 0;
  margin: 15px auto auto 10px;
}
section {
  color: #555555;
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 50px 0 50px 0;
  /*overflow: hidden;*/
  .order-nav {
    width: 100%;
    .order-nav-ul {
      height: 51px;
      display: flex;
      justify-content: space-around;
      line-height: 51px;
      background: #fff;
      border-bottom: 2px solid #ddd;
      li {
        height: 51px;
        width: 25%;
        text-align: center;
      }
      li.act {
        border-bottom: 2px solid #00bf9d;
        background: #f3f3f3;
        color: #00bf9d;
      }
    }
  }
  .all-order {
    width: 100%;
    background: #fff;
    .all-order-ul {
      display: flex;
      flex-direction: column;
      .all-order-li {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid #eee;
        position: relative;
        .order-wait {
          padding: 8px 8px 0 8px;
          color: #f60;
          font-size: 14px;
          text-align: right;
        }
        .order-info {
          height: 100px;
          display: flex;
          justify-content: space-around;
          text-align: center;
          text-align: center;
          line-height: 100px;
          padding: 0 10px 10px 10px;
          img {
            width: 80px;
            height: 80px;
            // margin-top: 10px;
          }
          .order-msg {
            width: 240px;
            font-size: 14px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
          }
        }
      }
    }
  }
  // 没有订单
  .order-none {
    .order-none-img {
      padding-top: 20px;
      width: 100%;
      height: 180px;
      img {
        width: 150px;
        height: 160px;
        text-align: center;
        margin-left: 112px;
      }
    }
    .order-none-msg {
      font-size: 22px;
      text-align: center;
      color: #999;
    }
    .order-none-btn {
      text-align: center;
      padding: 20px 0;
      width: 100%;
      .btn-msg {
        display: inline-block;
        width: 120px;
        height: 40px;
        border: 1px solid #ccc;
        text-align: center;
        line-height: 40px;
        color: #555;
      }
    }
  }

  .order-price {
          padding: 8px;
          display: flex;
          justify-content: end;
          .order-price-must {
            line-height: 25px;
            display: flex;
            margin-right: 20px;
            p {
              font-weight: 700;
            }
          }
          .pay {
            width: 70px;
            height: 25px;
            background: #f60;
            border-radius: 20px;
            color: #fff;
            text-align: center;
            line-height: 25px;
          }
        }
}
</style>